<?php

/*
	This file is part of Mandragon.

    Mandragon is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Mandragon is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Mandragon.  If not, see <http://www.gnu.org/licenses/>.
*/

db_do_query($page, db_query_insert(array('user_id', 'click_time', 'target_url', 'source_url', 'ipstring'), array(intval($_SESSION['user_id']), 'NOW(14)', db_sqlize($_GET['target_url']), db_sqlize($_GET['source_url']), db_sqlize($_SERVER["REMOTE_ADDR"]." - ".$_SERVER["HTTP_X_FORWARDED_FOR"])), "SPONS_CLICK"));

redirect($_GET['target_url']);

?>